home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / gconio.exe / GCONIO.DOC < prev    next >
Text File  |  1991-03-30  |  6KB  |  173 lines

  1.     GCONIO for Borland C++
  2.     =======================
  3.  
  4.  
  5.     Thank you for down loading gconio.zip!  I found text
  6.     I/O to be somewhat burdensome using the Borland BGI
  7.     outtext() routines so I wrote this class for the
  8.     graphics.
  9.  
  10.  
  11.     Simply include gconio.hpp in your applications.  The
  12.     GraphicsConsole class has member functions with the
  13.     same names as the conio.h i/o function prototypes.
  14.     These functions operate just like their conio.h
  15.     counter parts but in graphics modes with the current
  16.     font style!  You need to instantiate one instance
  17.     the of GraphicsConsole of course and only call its
  18.     member functions sandwiched between calls to
  19.     Borland's initgraph() and closegraph().
  20.  
  21.  
  22.     Compile and run gconio.cpp for a demonstration of
  23.     the GraphicsConsole class.  The demo's source code
  24.     appears in the function main() at the bottom of
  25.     gconio.cpp.  Study the demo's source code to see
  26.     how easy it is to use the GraphicsConsole class.
  27.  
  28.  
  29.     Besure to comment out "#define TEST_GCONIO_CPP"
  30.     just above main() before using gconio.cpp in
  31.     your applications.
  32.  
  33.  
  34.  
  35.  
  36.     Column Justification
  37.     ====================
  38.  
  39.     GraphicsConsole::cputs() operates on a column
  40.     concept when the justification is CENTER_TEXT or
  41.     RIGHT_TEXT for horizonal fonts and CENTER_TEXT or
  42.     TOP_TEXT for vertical fonts.  The CR/LF puts the CP
  43.     (current pointer) on the next line aligned with the
  44.     previous line instead of the left side of the
  45.     current viewport.  With LEFT_TEXT justify in
  46.     conjunction with a horizonal font, the CR/LF puts
  47.     the CP on the next line flush left with the current
  48.     viewport.  If you want to display a column, left
  49.     justified, then set GraphicsConsole::ColumnLeft to
  50.     true!  Then LEFT_TEXT justify works on the column
  51.     concept too.  The same is true with a vertical font
  52.     that is BOTTOM_TEXT justified.  Setting    ColumnLeft
  53.     to false will cause a CR/LF to put the CP on the
  54.     next line flush against the bottom of the viewport.
  55.     This is the most satisfactory arrangement that I
  56.     could come up with.  You will recall that outtext
  57.     only advances the CP with (LEFT_TEXT,TOP_TEXT)
  58.     justification!
  59.  
  60.  
  61.  
  62.     Write Mode for cprintf(), cputs(), putch() and
  63.     Stroked Fonts
  64.     ==============================================
  65.  
  66.     GraphicsConsole::OutputWriteMode only affects the
  67.     stroked fonts.  Normally, if not always, you will
  68.     want the text written on the graphics screen with
  69.     setwritemode(COPY_PUT).  If you want the output
  70.     text to be XOR_PUT onto the screen then assign
  71.     XOR_PUT to OutputWriteMode.
  72.  
  73.  
  74.  
  75.     Character Background for I/O
  76.     ============================
  77.  
  78.     Assign true to GraphicsConsole::ClearTextBk if you
  79.     want the background cleared before writing a
  80.     character.  GraphicsConsole::TextBkPattern specifies
  81.     the background fill pattern to be used in this case.
  82.     Its default is SOLID_FILL.
  83.  
  84.     GraphicsConsole::TextBkColor specifies the color of
  85.     the background fill.  If it is 0 (zero) then the
  86.     current background color is used.  Both
  87.     TextBkPattern and TextBkColor are used by the
  88.     backspace in cgets() to rub out the character
  89.     whenever GraphicsConsole::InputWriteMode is COPY_PUT
  90.     or the DEFAULT_FONT (non-stroked) is the current font.
  91.  
  92.  
  93.     Cgets(), cscanf() features
  94.     ==========================
  95.  
  96.     GraphicsConsole::InputWriteMode determines whether
  97.     stroked font characters echoed to the screen are
  98.     COPY_PUT or XOR_PUT.  The default is COPY_PUT.
  99.     Sometimes you may want to use XOR_PUT in which case
  100.     backspacing on input will erase the character if the
  101.     current font is stroked.  This is handy in paint
  102.     programs where you only want the finished line to be
  103.     COPY_PUT.  Set InputWriteMode to XOR_PUT and
  104.     InputRewrite to true to accomplish this.
  105.     InputRewrite being set to true causes the input line
  106.     to be rewritten in the COPY_PUT mode after the user
  107.     terminates the input line with enter.  On the other
  108.     hand, backspacing will "blacken" out the rubbed out
  109.     character if InputWriteMode is set to COPY_PUT or
  110.     the DEFAULT_FONT is current.  Wow!
  111.     You may want to reread this.
  112.  
  113.     GraphicsConsole::CursorChar is really a string of
  114.     one character.    (There were internal reasons for
  115.     making it a string.)  This is the cursor that is
  116.     displayed by cgets() and consequently cscanf().  I
  117.     chose the vertical bar "|" which is present in all
  118.     the supplied fonts.  If you don't want a cursor
  119.     displayed then assign the zero character to the
  120.     string, i.e. CursorChar[0] = '\0'.  CursorOnMsec and
  121.     CursorOffMsec are the parameters passed internally
  122.     to delay() to determine the blink rate.  100
  123.     milliseconds appears to be acceptable.  If you think
  124.     not then these are the variables to monkey with.
  125.  
  126.     It may seem odd for GraphicsConsole::InputDone to be
  127.     placed in public section of the GraphicsConsole class.
  128.     It controls the input loop for cgets().  The reason
  129.     it's there is so that any interrupt routine you may
  130.     have included in your application can automatically
  131.     terminate a cgets() in progress.  I am writing a
  132.     Paint program where I need the mouse interrupt to be
  133.     able to terminate the text paint tool which happens
  134.     to use GraphicsConsole::cgets().  Perhaps you may
  135.     need it too!  By the way the paint program is a demo
  136.     for cmouse.zip which I should be uploading soon.
  137.     The program is pretty primitive since it's only a
  138.     demo for cmouse.  The cmouse class has all 30 some
  139.     methods (mouse functions) and some other necessities
  140.     like an automatic interrupt handler, etc, which
  141.     should make your mouse programming a snap.
  142.  
  143.  
  144.  
  145.     Registration
  146.     ============
  147.  
  148.     If you find gconio useful and are using it in your
  149.     applications, tell your friends.  You don't need to
  150.     register gconio -- it's freeware!  All I ask is that
  151.     you leave my copyright notice intact!
  152.  
  153.  
  154.  
  155.  
  156.     Thanks again!
  157.  
  158.  
  159.     John W. Small
  160.     CIS: 73757,2233
  161.  
  162.     PSW / Power SoftWare
  163.     P.O. Box 10072
  164.     McLean, VA 22102 8072
  165.     (703) 759-3838
  166.  
  167.  
  168.  
  169.  
  170. Distributed by Public (software) Library.
  171. For a catalog of more than 3000 disks of pd/shareware, call 1-800-2424-PSL
  172. or write Public (software) Library, P.O.Box 35705, Houston, TX 77235-5705.
  173.